package jiezi.game 
{
	import flash.display.Loader;
	import flash.events.Event;
	import flash.net.URLRequest;

	/**
	 * ...
	 * @author ...
	 */
	public class jzTextureLoader
	{
		private var mLoader:Loader = null;
		private var mLoadingUrl:String;
		
		public function jzTextureLoader()
		{
			mLoader = new Loader();
			mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onBitmapLoadComplete)
		}
		
		public function load(url:String):void
		{
			mLoadingUrl = url;
			var urlReq:URLRequest = new URLRequest(url);
			mLoader.load(urlReq);
		}
		
		private function onBitmapLoadComplete(event:Event):void
		{
			jzTextureManager.getSingleton().addLoadedTexture(mLoadingUrl, mLoader.content, this);	
		}
	}

}